package com.hatch.events {
	
    import flash.events.Event;
    import flash.events.IEventDispatcher;    

    /**
     * Generic Bubbling Event to be broadcast from Objects
     * 
     * contains a data object to be filled @ instantiation
     * 
     * 
     * @author Andy Hatch
     */
    public class DataObjectEvent extends Event
	{
    	private var _data:Object;
    	
        public function DataObjectEvent(type:String, data:Object=null )
		{
        	super(type, true);
        	_data = data;
        }
        
        public function get data ():Object
		{
        	return _data;
        }
        
        override public function clone():Event
		{
        	return new DataObjectEvent( type, data );
        }
        
        static public function send( dispatcher:IEventDispatcher, type:String, data:Object=null ) : void
		{
            dispatcher.dispatchEvent( new DataObjectEvent( type, data) );
        } 
    }
}
